package service

import (
	"context"

	"gitee.com/thewalkers/refactoring-code/model"
)

// PaymentSchduleService acts as a struct for injecting an implementation of EmployeeRepository
// for use in service methods
type PaymentSchduleService struct {
	PaymentScheduleRepository model.PaymentScheduleRepository
}

// PSConfig will hold repository that will eventually be injected into this
// service layer
type PSConfig struct {
	PaymentScheduleRepository model.PaymentScheduleRepository
}

// NewPaymentSchduleService is a factory function for
// initializing a EmployeeService with its repository layer dependencies
func NewPaymentSchduleService(c *PSConfig) model.PaymentScheduleService {
	return &PaymentSchduleService{
		PaymentScheduleRepository: c.PaymentScheduleRepository,
	}
}

func (p *PaymentSchduleService) Create(ctx context.Context, paymentSchdule *model.PaymentSchedule) error {
	return p.PaymentScheduleRepository.Create(ctx, paymentSchdule)
}
